package com.qf.mxapp.controller;

import com.qf.mxapp.pojo.Img;
import com.qf.mxapp.result.ApiStatus;
import com.qf.mxapp.result.ResponseData;
import com.qf.mxapp.service.ImgService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("imgs")
public class ImgController {

    @Resource
    private ImgService imgService;
    @GetMapping("/{type}")
    public ResponseData<List> getImgByType(@PathVariable Integer type){
        List<Img> imgList = imgService.getImgListByType(type);
        return new ResponseData<>(ApiStatus.SUCCESS,imgList);
    }
}
